/**
 * @file 用户权限控制
 * @author its-wild(https://gitee.com/its-wild)
 * @date 2022/08/24
 */
import { useUserStore } from '@/store/user'
import { local } from '@/plugins/storage'

const sso = function (callback: () => any): void {
  const store = useUserStore()
  const user = local.get('user', null)

  store.setUser(user)
  callback && callback()
}

export default sso
